<template>
  <div id='tmpl'>
      <div class="isadd">
            <div class="insubtri" @click="insubtri">-</div>
            <div class="num">{{count}}</div>
            <div class="add" @click="add">+</div>
      </div>
  </div>
</template>
<script>
export default {
  name: "component_name",
  data () {
    return {
        count: 1
    };
  },
  methods: {
      insubtri(){
          this.count--;
          if(this.count<1){
              this.count = 1;
          }
          this.$emit("num",this.count);
      },
      add(){
         this.count++; 
         this.$emit("num",this.count);
      }
  }

}
</script>
<style lang="css" scoped>
.isadd div {
  display: inline-block;
  border: 1px solid #0094ff;
  width: 30px;
  height: 20px;
  line-height: 20px;
  text-align: center;
}
.isadd div:hover{ /* 这个样式用于pc端 */
    cursor: pointer;
}
</style>